Cytosim  PI
Cytoskeleton Simulator
FiberSet Class Reference

Detailed Description

The FiberSet stores Fiber, and derived classes. Algorithms that specifically deal with Fibers should be contained here.

Inheritance diagram for FiberSet:
ObjectSet

Public Member Functions

 FiberSet (Simul &s)
 creator
 
virtual ~FiberSet ()
 destructor
 
std::string kind () const
 identifies the class
 
PropertynewProperty (const std::string &kind, const std::string &name, Glossary &) const
 create a new property for class kind with given name
 
ObjectnewObject (const std::string &kd, const std::string &nm, Glossary &opt)
 create a new Fiber from the corresponding property More...
 
ObjectList newObjects (const std::string &kd, const std::string &nm, Glossary &opt)
 create new Fibers
 
ObjectnewObjectT (const Tag tag, int prop_index)
 construct Fiber More...
 
Fiberfirst () const
 first Fiber
 
Fiberlast () const
 last Fiber
 
Fiberfind (Number n) const
 return pointer to the Object of given inventory Number, or zero if not found
 
void cutAlongPlane (Vector const &n, real a, bool(*func)(Object const *, void *), void *)
 Cut all segments intersecting the plane defined by n.x + a = 0 More...
 
void step ()
 Monte-Carlo step for every Fiber. More...
 
void foldPosition (const Modulo *) const
 modulo the position (periodic boundary conditions)
 
void uniFiberSites (Array< FiberBinder > &, const real spread) const
 set random sites along the fibers, separated on average by spread More...
 
int count (bool(*func)(Fiber const *, void *), void *) const
 number of Fiber that do not belong to an Organizer
 
real totalLength () const
 total length of Fiber
 
real totalLength (FiberProp const *) const
 total length of Fiber that have ( FiberProp == p )
 
void infoLength (unsigned int &cnt, real &avg, real &dev, bool(*func)(Fiber const *, void *)=0, void *=0) const
 calculate: number of fibers, mean and standard-deviation of fiber length
 
void infoSegments (unsigned &cnt, unsigned &joints, unsigned &kinks, real &, real &, bool(*func)(Fiber const *, void *)=0, void *=0) const
 calculate: number of fibers, number of joints and number of kinks
 
real infoDirection (Vector &G, Vector &D, Vector &N, bool(*func)(Fiber const *, void *)=0, void *=0) const
 calculate: center of gravity G, average direction D, average nematic direction N More...
 
void infoIntersections (int &np, int &na, Vector const &n, real a) const
 Count Fibers intersecting the plane defined by n.x + a = 0 More...
 
void infoSpindle (real &ixa, real &ixs, Vector const &n, real a, real m, real da) const
 Calculate spindle indices. More...
 
void infoTension (unsigned int &, real &hten, Vector const &n, real a) const
 sum Lagrange multipliers for segments that intersect the plane n.x + a = 0 More...
 
void infoTension (unsigned int &, real &hten) const
 sum Lagrange multipliers for all fibers More...
 
void infoRadius (unsigned int &, real &rad) const
 Calculate averaged distance from origin - for all model points.
 
void infoRadius (unsigned int &, real &rad, FiberEnd) const
 Calculate averaged distance from origin - for fiber ends.
 
- Public Member Functions inherited from ObjectSet
virtual void freeze ()
 transfer all nodes to list ice
 
virtual void thaw (bool erase)
 erase objects, or put them back in normal list
 
 ObjectSet (Simul &s)
 creator
 
virtual ~ObjectSet ()
 destructor
 
virtual ObjectList newPlacedObjects (const std::string &kind, const std::string &name, Glossary &opt)
 create new objects, translate and rotate them according to specifications in opt More...
 
virtual void add (Object *)
 register Object, and add it at the end of the list
 
void add (ObjectList &)
 remove Object in ObjectList
 
virtual void remove (Object *)
 remove Object
 
void remove (ObjectList &)
 remove Object in ObjectList
 
virtual void relink (Object *)
 unlink and relink object. This places it last in the list More...
 
void erase (Object *)
 remove Object, and delete it
 
virtual void erase ()
 delete all Objects in list and forget all serial numbers
 
virtual unsigned size () const
 number of elements
 
virtual void mix ()
 mix the order of elements in the doubly linked list nodes
 
Objectfirst () const
 first Object in the list
 
Objectfirst (const Property *) const
 return an Object which has this property More...
 
Objectlast () const
 last Object
 
Objectfind (const Number n) const
 find Object of given serial-number (see Inventoried)
 
ObjectfindObject (long n) const
 return Object with serial-number if ( n > 0 ) or object from the end of the list if ( n <= 0 ) More...
 
virtual ObjectList collect (bool(*func)(Object const *, void *), void *) const
 collect Object for which func(obj, val) == true
 
void readObject (InputWrapper &, Tag, char pretag)
 read one Object from file More...
 
virtual void write (OutputWrapper &out) const
 write all Objects to file
 

Additional Inherited Members

- Static Public Member Functions inherited from ObjectSet
static void translateObjects (ObjectList const &, Vector const &)
 apply translation to all Objects in ObjectList More...
 
static void rotateObjects (ObjectList const &, Rotation const &)
 apply rotation to all Objects in ObjectList More...
 
- Public Attributes inherited from ObjectSet
Inventory inventory
 holds pointers to the Objects in a array of Numbers
 
NodeList nodes
 holds pointers to the Objects in a doubly linked list
 
Simulsimul
 the Simul containing this ObjectSet
 
- Protected Member Functions inherited from ObjectSet
void forget (NodeList &)
 remove all nodes in the list from the inventory
 
virtual void link (Object *)
 link the object last in the list More...
 
- Static Protected Member Functions inherited from ObjectSet
static ObjectList collect (const NodeList &, bool(*func)(Object const *, void *), void *)
 collect Object from NodeList for which func(obj, val) == true
 
static void write (const NodeList &, OutputWrapper &)
 write Object in NodeList to file More...
 
static Vector placeObjects (ObjectList const &, Glossary &opt, const Space *)
 place all Objects in ObjectList using the same combinations of translation/rotation More...
 
- Protected Attributes inherited from ObjectSet
NodeList ice
 a list used to store the objects temporarily while a state is imported
 

Member Function Documentation

void cutAlongPlane ( Vector const &  n,
real  a,
bool(*)(Object const *, void *)  func,
void *   
)

Cut all Fibers along the plane defined by n.x + a = 0. function argument func can be specified to specify which fibers can be cut. If ( func != 0 ), a fiber fib will be cut only if

func(fib, arg) == true
real infoDirection ( Vector G,
Vector D,
Vector N,
bool(*)(Fiber const *, void *)  func = 0,
void *  arg = 0 
) const

Each Fiber segment is weigthed by its length.

Returns
G = average center of gravity
D = average direction
N = average nematic direction

To calculate the Nematic direction, we average the square of the imaginary number representing the direction vector.

This works in 2D by producing a nematic tensor, but in 3D this is only correct if the average direction is roughly already aligned with the X-axis.

Todo:
better nematic tensor calculation in 3D.
void infoIntersections ( int &  np,
int &  na,
Vector const &  n,
real  a 
) const

Counts the number of fiber intersecting the plane defined by n.x + a = 0 in two categories, depending on the direction with which they cross the plane:

  • np = number of parallel segments ( the scalar product dir.n is strictly positive )
  • na = number of anti-parallel segments ( dir.n < 0 )
void infoSpindle ( real ixa,
real ixp,
Vector const &  n,
real  a,
real  m,
real  dm 
) const

Calculate two indices characterizing the organization of the fibers along the axis n.

  • ixa = average { ( o - i ) }
  • ixp = average { ( r - l ) }

where:

  • o = number of fiber pointing outward (away from the mid-plane),
  • i = number of fiber pointing inward (toward the mid-plane),
  • r = number of fiber pointing right (in direction of n),
  • l = number of fiber pointing left.

The indices are averaged over planar sections taken every dm units of space, and the values for each planar section are weighted by the number of fibers. The central symmetry plane is defined by n.x+a=0, and the edges correspond to n.x+a=+/-m.

The results characterize broadly the type of fiber organization:

  • ixa = 1, ixp = 0: aster,
  • ixa = -1, ixp = 0: anti-aster,
  • ixa = 0, ixp = 1: parallel overlap,
  • ixa = 0, ixp = 0: anti-parallel overlap (50/50).
void infoTension ( unsigned int &  cnt,
real ten,
Vector const &  n,
real  a 
) const

Sum tension of all the segments that intersect the plane defined by n.x + a = 0 The tension dipole along the segment is obtained from the Lagrange multiplier associated with the length of each segment. The magnitude of the dipole is multiplied by the cosine of the angle between the segment and the plane normal.

Returns
cnt = number of segments intersecting the plane
ten = sum of tension
void infoTension ( unsigned int &  cnt,
real ten 
) const

Sum tension of all the segments

Returns
cnt = number of segments intersecting the plane
ten = sum of tension
Object * newObject ( const std::string &  kd,
const std::string &  nm,
Glossary opt 
)
virtual

The initialization options depends on the type of fiber: Fiber, DynamicFiber, ClassicFiber, Tubule.

Implements ObjectSet.

Object * newObjectT ( const Tag  tag,
int  idx 
)
virtual

The fiber is not initialized, since this is used for file input

Implements ObjectSet.

void step ( )

Calculate the free monomer concentration. Calls step() once for every Fiber.

void uniFiberSites ( Array< FiberBinder > &  res,
const real  spread 
) const

Set a list of Locations on the fibers, chosen randomly with uniform sampling. The number of site over a stretch of length len should be len/spread .

Condition: ( spread > 0 )